package com.rose.doorto.footbathdoor.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rose.doorto.footbathdoor.mapper.UserMapper;
import com.rose.doorto.footbathdoor.pojo.User;
import com.rose.doorto.footbathdoor.service.IUserService;
import com.rose.doorto.footbathdoor.vo.LoginVo;
import com.rose.doorto.footbathdoor.vo.RegVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 用户信息表 服务实现类
 * </p>
 *
 * @author lqc
 * @since 2024-07-08
 */
@Transactional
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Autowired
    private UserMapper userMapper;

    /**
     * 登录操作
     * @param loginVo
     * @return
     */
    @Override
    public User login(LoginVo loginVo) {
        return userMapper.login(loginVo);
    }

    @Override
    public int regist(RegVo regVo) {
        int regist = userMapper.regist(regVo);
        return regist;

    }


    /**
     * 根据手机号查询该用户是否存在
     * @param mobile
     */
    public User getMobile(String mobile) {
        return userMapper.getMobile(mobile);
    }
}
